package org.example.Service;

import org.example.mapper.OrderDetailsMapper;
import org.example.pojo.OrderDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderDetailsServiceImpl implements OrderDetailsService{
    @Autowired
    private OrderDetailsMapper orderDetailsMapper;
    @Override
    public List<OrderDetails> selectOrderDetails() {
        return orderDetailsMapper.selectOrderDetails();
    }

    @Override
    public OrderDetails selectOrderDetailsByID(Integer id) {
        return orderDetailsMapper.selectOrderDetailsByID(id);
    }

    @Override
    public OrderDetails selectOrderDetailsByOrderID(Integer order_id) {
        return orderDetailsMapper.selectOrderDetailsByOrderID(order_id);
    }

    @Override
    public int insertOrderDetails(OrderDetails orderDetails) {
        return orderDetailsMapper.insertOrderDetails(orderDetails);
    }

    @Override
    public int updateOrderDetails(OrderDetails orderDetails) {
        return orderDetailsMapper.updateOrderDetails(orderDetails);
    }

    @Override
    public int deleteOrderDetails(Integer id) {
        return orderDetailsMapper.deleteOrderDetails(id);
    }

    @Override
    public int deleteOrderDetailsByOrderID(Integer order_id) {
        return orderDetailsMapper.deleteOrderDetailsByOrderID(order_id);
    }
}
